package com.borrow.service;

import com.borrow.mapper.BorrowMapper;
import com.entity.BorrowBookVo;
import com.entity.BorrowEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BorrowServiceImpl implements BorrowService {
    @Autowired
    BorrowMapper mapper;

    @Override
    public int addBorrow(BorrowEntity entity) {
        return mapper.addBorrow(entity);
    }

    @Override
    public List<BorrowBookVo> borrowBook(BorrowBookVo vo) {
        vo.setPageStart(vo.getPage(), vo.getLimit());
        return mapper.borrowBook(vo);
    }

    @Override
    public int borrowBookCount(BorrowBookVo vo) {
        vo.setPageStart(vo.getPage(), vo.getLimit());
        return mapper.borrowBookCount(vo);
    }


}
